package cn.leftsite.java11;

public class StringDemo {
    public static void main(String[] args) {
        var str = "\t \r\n";
        // 判断字符串的字符是否都是空白字符
        System.out.println(str.isBlank());

        str = " \t \r\n abc \t  ";

        // 去除字符串首尾的空白, 包括非英文空白
        System.out.println(str.strip());
        System.out.println(str.strip().length());

        System.out.println(str.stripLeading().length());
        System.out.println(str.stripTrailing().length());

        System.out.println(str.strip());
        System.out.println(str.strip().length());

        System.out.println(str.trim());
        System.out.println(str.trim().length());

        System.out.println("abc".repeat(3));
        System.out.println("A\nB\nC".lines().count());

    }
}
